package mark.tom.friend;

import android.content.Context;
import android.support.annotation.NonNull;

public class FRoll {

    private static Facade facade;
    private static String cPackageName;

    public static FRollBuilder init(Context mContext) {
        return new FRollBuilder(mContext);
    }

    static void build(@NonNull FRollBuilder builder) {
        facade = new DefaultFacade(builder);
        cPackageName = builder.packageName;
    }

    public static ConfigContent get() {
        return get(cPackageName);
    }

    public static ConfigContent get(@NonNull String packageName) {
        if (null == facade) {
            throw new IllegalArgumentException("FRoll Should be Init First");
        }
        return facade.execute(packageName);
    }
}
